//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_getwreck.sqf"
#include "x_setup.sqf"

if (isSteamMission) exitWith {endMission "LOSER"};
private ["_no","_rep_station","_types"];
PARAMS_2(_rep_station,_types);
_no = nearestObjects [_rep_station, _types, 8];
if (count _no == 0) exitWith {objNull};
if (damage (_no select 0) >= 1) then {_no select 0} else {objNull}
